#ifndef LEFTFORM_H
#define LEFTFORM_H

#include <QWidget>
#include <QPropertyAnimation>

namespace Ui {
class leftForm;
}

class leftForm : public QWidget
{
    Q_OBJECT

public:
    explicit leftForm(QWidget *parent = nullptr);
    ~leftForm();

    //设置文本及图标
    void setIconAndText(const QString &text, const QString &img, int pageIndex);
    void mousePressEvent(QMouseEvent *event);

    //获取页面id
    int getpageIndex();
    void clearStyle();

    //设置控件动画
    void initPropertyAnimation();

    //显示动画
    void showAnimation(bool isShowing);
signals:
    void pageChange(int pageIndex);
    void leftClicked(bool clicked);
private:
    Ui::leftForm *ui;
    int pageIndex;
    QPropertyAnimation* animation;
};

#endif // LEFTFORM_H
